﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WLWZGao6.APItitlion.IService;
using WLWZGao6.Domain.Common;
using WLWZGao6.Domain.Model;
using WLWZGao6.Domain.IRepository;
using WLWZGao6.Domain.Dto;

namespace WLWZGao6.APItitlion.Service
{
    public class UserService :IUserService
    {
        public IUserService _userService;
        public IUserRepository _userRepository;
        public UserService(IUserRepository userRepository,IUserService userService)
        {
            _userService = userService;
            _userRepository = userRepository;
        }
        public object CheckuserAndpwd(UserLoginDto user)
        {
            var ss = _userRepository.Login(user);
            return ss;
        }
        //用户登录
        public EData Login(UserLoginDto user)
        {
            return _userRepository.Login(user);
        }
        public EData UserAdd(User user)
        {
            return _userRepository.UserAdd(user);
        }

        public EData UserDel(int Ids)
        {
            return _userRepository.UserDel(Ids);
        }

        public EData UserShow(string Name)
        {
            return _userRepository.UserShow(Name);
        }

        public EData UserUpd(int Ids, User user)
        {
            return _userRepository.UserUpd(Ids, user);
        }
        //用户添加角色
        public EData UserRoleAdd(int Ids, string roleId)
        {
            return _userRepository.UserRoleAdd(Ids, roleId);
        }

        public object CheckuserAndpwd(string userName, string userPass)
        {
            return _userService.CheckuserAndpwd(userName, userPass);
        }
    }
}
